﻿Public Class Configuracion

    'Shared _cadenaConexion As String = "Data Source=.\MSPDeveloper;Initial Catalog=Tienda;User ID=sa;Password=mredison"

    Shared _cadenaConexion As String
    Shared _serverName As String
    Shared _bdName As String
    Shared _userBDName As String
    Shared _passBD As String

    Public Property serverName() As String
        Get
            Return _serverName
        End Get
        Set(ByVal value As String)
            _serverName = value
        End Set
    End Property

    Public Property bdName() As String
        Get
            Return _bdName
        End Get
        Set(ByVal value As String)
            _bdName = value
        End Set
    End Property

    Public Property userBDName() As String
        Get
            Return _userBDName
        End Get
        Set(ByVal value As String)
            _userBDName = value
        End Set
    End Property

    Public Property passBD() As String
        Get
            Return _passBD
        End Get
        Set(ByVal value As String)
            _passBD = value
        End Set
    End Property

    Public Shared ReadOnly Property getCadenaConexion() As String
        Get
            Return _cadenaConexion
        End Get
    End Property

    Public Shared Sub setCadenaConexion()

        'Por ip del server
        _cadenaConexion = "Data Source=192.168.10.59\sql;Initial Catalog=Integracion;Integrated Security=SSPI;Trusted_Connection=false;Connection Timeout=5;User ID=sa;Password=;"
        'Por nombre del servidor
        '_cadenaConexion = "Data Source=sqlcluster3\sql;Initial Catalog=Integracion;Integrated Security=SSPI;Trusted_Connection=false;Connection Timeout=5;User ID=sa;Password=;"
        '_cadenaConexion = "Data Source=" & serverName & ";Initial Catalog=" & bdName & ";Integrated Security=SSPI;Trusted_Connection=false;User ID=" & userBDName & ";Password=" & passBD & ";"

    End Sub



End Class
